package com.cqnu.entity.commonModel;

import java.util.List;
import com.cqnu.entity.Menu;

public class Tree{
	private int id;
	private String text;// 显示文本
	private String state;// 状态 close,open
//	private int parentId;// 父id
	private String iconCls;// 图标
	private boolean checked;// 是否被选中
	private Attribute attributes;// 扩展属性
	private List<Tree> children;// 子集
//	private int order;// 排序
	private String url;
	private boolean leaf;

	public Tree() {
	};

	public Tree(Menu menu) {
		id = menu.getId();
		text = menu.getName();
		attributes = new Attribute();
		attributes.setUrl(menu.getUrl());
		iconCls = "";
	}

	public Tree(int checkboxId) {
		attributes = new Attribute();
		attributes.setCheckboxId(checkboxId);
	}



	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public List<Tree> getChildren() {
		return children;
	}

	public void setChildren(List<Tree> children) {
		this.children = children;
	}

//	public int getParentId() {
//		return parentId;
//	}
//
//	public void setParentId(int parentId) {
//		this.parentId = parentId;
//	}

	public String getIconCls() {
		return iconCls;
	}

	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}

	public Attribute getAttributes() {
		return attributes;
	}

	public void setAttributes(Attribute attributes) {
		this.attributes = attributes;
	}

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

//	public int getOrder() {
//		return order;
//	}
//
//	public void setOrder(int order) {
//		this.order = order;
//	}

	public boolean isLeaf() {
		return leaf;
	}

	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
